import request from '@/utils/request';
import { AxiosResponse } from 'axios';

// 定义通用API响应接口
export interface ApiResponse<T> {
  code: number;
  msg: string;
  data: T;
}

// 定义首页数据的接口
export interface OrderItem {
  orderId: string;
  productCode: string;
  productName: string;
  progress: number;
}

export interface HomeData {
  // orders: OrderItem[];
}

export function getHomeData(params?: any): Promise<ApiResponse<HomeData>> {
  return request.get<ApiResponse<HomeData>>('/saleservice/evaluationPage', { params })
    .then((response: AxiosResponse<ApiResponse<HomeData>>) => {
      return response.data;
    });
} 